Skip to content

fix(api): apply or remove ignored tool parameters - #285

Merged
mixelpixx merged 13 commits into
mixelpixx:mainfrom
nordic-style:codex/test/schema-parameter-usage
Aug 25, 2026
Merged

fix(api): apply or remove ignored tool parameters#285
mixelpixx merged 13 commits into
mixelpixx:mainfrom
nordic-style:codex/test/schema-parameter-usage

Conversation

@nordic-style

@nordic-style nordic-style commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

User-visible problem and scope

Konnect advertised public MCP inputs that some handlers never read. Clients could therefore receive a success response even though the requested behavior was not applied.

This PR rebases and consolidates the remaining #251 fixes on current main. Each advertised input is now either implemented or deliberately removed with migration guidance. A catalogue-wide regression test prevents the same bug class from returning.

Closes #251

Consolidated changes

The branch also includes #267's smaller ignore_power_pins implementation as a temporary stacked prerequisite: the guard correctly detects that existing ignored input. #280 is intentionally excluded as its duplicate. Once #267 lands, this branch can be rebased to remove the duplicate commit.

Already-merged #266, #271, #274, and #276 are inherited from main and are not duplicated here. #272 and #280 are not part of this branch.

Root cause and design

The public schemas and their handlers previously evolved independently, with no catalogue-wide proof that every input reached executable code. The new test starts from the registered tool catalogue, locates each real handler, and follows reachable helpers and macros. Its lexer ignores comments and ordinary, raw, byte, and character literals so examples cannot masquerade as implementation. Same-file helper resolution wins when names are duplicated; cross-file helpers remain discoverable when no local definition exists.

Every schema property must appear in its handler's reachable implementation. There is no tool/parameter allowlist. The complete 202-tool catalogue is checked in about 0.24 seconds locally.

Compatibility and migration

Implemented inputs keep their public names and defaults and now affect the requested operation. Eight previously inert inputs are removed: import_sheet_pins.project_name, refill_zones.zones, run_drc.tests, audit_decoupling.board, audit_decoupling.max_distance_mm, export_manufacturing_package.quantity, validate_for_manufacturing.schematic, and estimate_cost.schematic.

Each removal and its supported replacement workflow is documented in docs/API_MIGRATIONS.md and enforced by schema_migrations.rs.

Validation

All commands required by CONTRIBUTING.md pass on this exact consolidated branch:

  • cargo test --workspace --locked --lib --tests
  • cargo test --workspace --locked --doc
  • cargo clippy --workspace --locked --all-targets -- -D warnings
  • cargo fmt --all -- --check

The focused catalogue guard also passes 5/5 with cargo test -p konnect --test schema_parameter_usage --locked -- --nocapture. Live-GUI tests remain intentionally ignored by the upstream suite unless a running KiCad GUI/socket is supplied.

Risk and rollback

This is intentionally an integration PR, but the runtime fixes remain separated into focused commits. The main risks are incorrect KiCad CLI argument mapping, geometry conversion, board identity checks, and UI-process detection. Direct argv tests, real-format fixtures, and focused regressions cover those paths. The guard's static call-graph risk is covered by lexer, helper, macro, and duplicate-name tests. Any runtime area can be rolled back independently by reverting its focused commit.

@mixelpixx

Copy link
Copy Markdown
Owner

A maintainer note on this whole series (#264#285, #294), since this draft is its integration branch.

First: thank you. The individual work here is genuinely good — where I deep-reviewed (#266, #278, #294), the root-cause analysis was accurate, the tests assert on real argv/fixtures rather than circularly on the code's own behavior, and #294 anticipates the exact safety hazard a reviewer would raise. Four PRs from this series are merged as of tonight (#266, #271, #274, #276), and more will follow.

But the series was submitted as ~22 independent PRs and it is not internally coordinated, which creates real review hazards I need you to fix before the rest can land:

  1. fix(schematic): respect intentional unconnected pins #267 and fix(schematic): honor ignored power pins #280 are the same fix filed twice. Both add the identical ignore_power_pins filter to validate_component_connections in sch_batch.rsfix(schematic): respect intentional unconnected pins #267 framed as part of sch_batch, sch_export, sch_analysis and design_review still resolve pins against unit 1 #182, fix(schematic): honor ignored power pins #280 framed as part of Tools accept parameters they never apply and report them as honoured #251 and stacked on fix(schematic): resolve pins through their placed unit #272. Whichever lands first breaks the other. Please pick one (I'd keep fix(schematic): respect intentional unconnected pins #267's framing, it's the smaller diff) and drop or reduce the other to its non-duplicate remainder.

  2. fix(export): pass KiCad single-file plot arguments #266 and fix(exports): verify every reported artifact #270 independently rewrote the same export_pdf function with different helper names. fix(export): pass KiCad single-file plot arguments #266 is merged (it also fixed SVG, which fix(exports): verify every reported artifact #270 did not). fix(exports): verify every reported artifact #270's artifact-verification core (issue [BUG] snapshot_project returns artifact paths it never verifies #252) is still wanted — please rebase it over current main so it keeps only that.

  3. Eight PR bodies repeat the same sentence verbatim — "Combined-series CI commands: … 585/588 tests pass" — describing the combined branch, not each PR's own diff. That means no individual PR in the Tools accept parameters they never apply and report them as honoured #251 series has independently stated evidence. Going forward, per-PR claims need per-PR runs; CONTRIBUTING asks for exactly that.

  4. This draft (fix(api): apply or remove ignored tool parameters #285) is the right shape for the Tools accept parameters they never apply and report them as honoured #251 remainder. Rather than me merging fix(manufacturing): apply Gerber and position options #269/fix(export): apply every advertised output option #277/fix(api): remove ignored tool parameters #278/fix(project): verify the requested open board #279/fix(pcb): create rounded board outlines #281/fix(library): apply pad shape edits #282/fix(verification): bound the KiCad UI health check #283/fix(pcb): validate the requested routing board #284 one at a time with cascading rebases, let's land the series through this branch: rebase it over current main (which now carries feat(netclass): add get_netclasses, the read path net classes never had #259, fix(sch): resolve power symbols in the schematic net graph #262, fix(sch): refuse run_erc on a sub-sheet and name the root #263, fix(export): pass KiCad single-file plot arguments #266, fix(sch): resolve pins in find_orphan_items #271, fix(library): inspect footprint structure #274, fix(integration): stop advertising unavailable autoroute #276, fix(sch): keep every item of an ERC violation #297, fix(pcb): keep every item of a DRC violation #298 — several of your satellites will shrink or empty out), un-draft it, and I'll review it as one unit with its catalogue-wide schema-parameter guard as the proof. One request on that guard: derive its exemptions from the schemas themselves, not an allowlist — a previous allowlist-based guard here accumulated 22 phantom entries and suppressed the evidence for the bug it was meant to catch ([BUG] Correct stale and invalid guidance in bundled skills #217).

On identity: the branch prefixes say Codex, and the volume says automation. That's fine here — the code quality carries it — but the coordination failures above are exactly what an automated pipeline doesn't catch on its own. Run the cross-check between your own open PRs before filing, and this series becomes easy to take.

Forward schematic and PCB monochrome settings, schematic theme and page selection, and 3D unspecified-model policy to kicad-cli. Restrict the BOM format contract to KiCad's CSV output.

Refs mixelpixx#251
Narrow eight schemas to behavior their handlers can verify, correct overstated tool descriptions, and document a replacement workflow for every public input removal.

Refs mixelpixx#251
Resolve project paths to their sibling PCB, query KiCad's real open-document list, and return an honest per-path result instead of ignoring open_project.path.

Refs mixelpixx#251
Apply corner_radius as four circular KiCad arcs plus shortened sides over both IPC and the file fallback, rejecting overlapping or degenerate geometry.

Refs mixelpixx#251
Validate supported standard pad shapes, update the pad header atomically, add or remove KiCad shape-specific children, and preserve an omitted size dimension.

Refs mixelpixx#251
Validate timeout_seconds and apply one Tokio deadline to process detection plus IPC ping, reporting timeout state and elapsed time explicitly.

Refs mixelpixx#251
Treat pcbnew and eeschema as GUI processes on every platform, and let a responsive IPC endpoint prove that KiCad is running even when process inspection misses its launcher. Report process detection separately for diagnostics.\n\nRefs mixelpixx#251
Make every IPC-backed routing operation resolve the advertised board path and refuse to operate unless that exact board is active in KiCad. This prevents a valid request from silently mutating whichever board happens to be open.\n\nRefs mixelpixx#251
Derive registered handlers and their transitive helper/macro call graph from source, then compare every advertised schema property with the implementation's parameter reads. Same-file resolution prevents duplicate helper names from hiding real drift, and the full catalogue check needs no allowlist.\n\nRefs mixelpixx#251
The component validator reported pins declared no-connect, ignored its public power-pin option, and projected every unit's pins through each placed unit. Preserve KiCad electrical types, honor the filter, exempt explicit and intrinsic no-connect pins, and resolve only the selected unit.

Refs mixelpixx#182
@nordic-style

Copy link
Copy Markdown
Contributor Author

Consolidation requested in the maintainer review is complete:

This PR is ready for review as the single remaining #251 path.

@mixelpixx
mixelpixx merged commit c061a6d into mixelpixx:main Aug 25, 2026
9 checks passed
mixelpixx added a commit that referenced this pull request Aug 25, 2026
The #285 schema-parameter guard caught the refusing stub advertising four
parameters its handler no longer reads — exactly the class it exists to
catch, on its first day on main. Documented in docs/API_MIGRATIONS.md beside
the #285 removals.

Refs #315

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
mixelpixx added a commit that referenced this pull request Aug 25, 2026
The community release: eighteen of the changes came from outside
contributors. Repairs boards damaged by v0.4.0-v0.6.1 (#294), fixes
set_board_size's outline stacking present since the first release (#314),
makes move_connected honest (#315), enforces schema-parameter truth
catalogue-wide (#285/#251), lands the shared connectivity index (#323),
IPC-first board info with User paper dimensions (#207/#324), live zone
creation (#316), the anyn99 schematic-fix series (#307-#313), sheet-pin
rotation (#317), and neusse's developer docs (#306). ROADMAP rebuilt on
discussion #165.

19 toolsets, 204 registered tools / 210 total.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
GouldCarl added a commit to GouldCarl/Konnect that referenced this pull request Sep 6, 2026
move_connected (mixelpixx#315, BoatDash backlog mixelpixx#17) refused unconditionally: since
the first release it had silently delegated to move_schematic_component
while reporting connections preserved. This implements the documented
contract instead of merely re-wording the refusal, so `feat` rather than
`fix`.

Root cause: no code ever carried anything anchored at a moved symbol's old
pin positions, and mixelpixx#315's own fix (183b43a) papered over that by refusing
the call rather than building the carry.

Change (crates/konnect-core/src/tools/sch_components.rs,
crates/konnect-core/src/mcp/error.rs):
- handle_move_connected now moves every placed unit (like
  move_schematic_component) and carries labels (net/global/hierarchical),
  power symbols, and no-connect flags whose position coincided with an old
  pin, plus the touching end of any wire.
- A wire is stretched only if it stays horizontal or vertical; if any wire
  would go diagonal, the whole move is refused before anything is written,
  naming the wire(s) and a delta along their own axis that would stay
  orthogonal (new ToolErrorKind::WouldGoDiagonal).
- Junction dots are re-judged by the same reconcile_junctions_after_move
  pass move_schematic_component already uses (mixelpixx#120) — no second opinion
  about junctions.
- Response fields (moved_units, labels_moved_count, power_symbols_moved,
  no_connects_moved_count, wire_endpoints_moved_count,
  junctions_added/pruned_count) are all read from what was actually
  mutated, never echoed from the request.

Tests (crates/konnect-core/src/tools/sch_components.rs,
move_connected_tests): a four-pin fixture with a label/power
symbol/no-connect/wire stub on each pin proves the carry and the
orthogonal wire stretch, with response counts checked against a read-back
of the written file; a second case proves the whole move is refused with
nothing written when a wire would go diagonal (refusal path exercised
before the success path); a third proves a multi-unit symbol moves every
placed unit by the shared delta.

Gates (see C:\GitRepos\Konnect-evidence\17-move-carries-attachments\README.md
for the full before/after run against the io-expander corpus):
netlist_diff identical partition after a move that used to break it,
sch_layout_check 0 findings, ERC unchanged; diagonal case refused with
the file byte-identical to before the call.

CI-equivalent: cargo fmt --check clean; cargo clippy -D warnings clean;
cargo test --workspace --lib --tests 1001+ passed, 0 failed; cargo test
--workspace --doc all passed.

Neuter check: disabling the diagonal-refusal guard alone fails
a_move_that_would_put_a_wire_off_axis_is_refused_and_nothing_is_written;
disabling the carry logic alone (via a shadowed at_old_pin closure)
fails labels_power_and_no_connects_are_carried_and_the_orthogonal_wire_end_is_stretched.
Both were restored to the exact original text afterward.

docs/API_MIGRATIONS.md: updated the mixelpixx#285 removal entry to note the
parameters are live again now that the feature is implemented.

Part of mixelpixx#315 (mixelpixx/Konnect): the maintainer's comment on that issue
says a wire-carrying move needs the mixelpixx#120 connectivity model, which
reconcile_junctions_after_move already provides — the acceptance
criteria in issue-draft.md track the remainder.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tools accept parameters they never apply and report them as honoured

2 participants